/* ****************************************************************************
 *
 * Copyright (c) Microsoft Corporation. 
 *
 * This source code is subject to terms and conditions of the Microsoft Public License. A 
 * copy of the license can be found in the License.html file at the root of this distribution. If 
 * you cannot locate the  Microsoft Public License, please send an email to 
 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
 * by the terms of the Microsoft Public License.
 *
 * You must not remove this notice, or any other, from this software.
 *
 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
 * PARTICULAR PURPOSE.
 * ***************************************************************************/



#if !defined(AFX_PGLSTATIC_H__1A9613EC_66EC_4F62_B813_5A19FC4C66CE__INCLUDED_)
#define AFX_PGLSTATIC_H__1A9613EC_66EC_4F62_B813_5A19FC4C66CE__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PGLStatic.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CPGLStatic window

/*! \brief A CStatic derived class

  \ingroup PGLMFCGroup
*/
class PGLMFC_EXT_CLASS CPGLStatic : public CStatic
{
// Construction
public:
	//! Option flag enumeration
	enum EOption
	{
		//! No zoom all in OnInitDialog
		OptionNoZoomAll =			0x0001,
		//! Triple buffering
		OptionTripleBuffering =		0x0002
	};
	//! \name Constructors
	//@{
	//! Construct the static control with pRegion (can be NULL)
	CPGLStatic(CPGLRegionPtr pRegion = CPGLRegionPtr(), DWORD eFlags = 0);
	//@}

// Attributes
public:

// Operations
public:
	//! \name Public Methods
	//@{
	//! return graph pointer
	CPGLRegionPtr  GetRegion()									{	return m_pRegion;};
	//! Set the PGL region to draw.
	void SetRegion(CPGLRegionPtr  _region)						{	m_pRegion=_region; m_GDIpHelper.SetRegion(_region);};
	//! return gfx interface
	gfxinterface::CGDIpInterface& GetGfxInterface()				{	return m_GDIpInterface;};
	//! return gfx interface, const
	const gfxinterface::CGDIpInterface& GetGfxInterface() const	{	return m_GDIpInterface;};
	//! Draw static control...
	void Draw();
	//@}

	//! \name Redrawing
	//@{
	//! enables disables triple buffering
	void SetTripleBuffering(bool on = true);
	//! Makes rebuilding memory bitmap and redrawing the chart
	void SetDirty();
	//! Makes rebuilding memory bitmap and redrawing the chart
	void SetFrontDirty();
	//! Makes blitting of memory bitmap
	void SetCacheDirty();
	//@}

	// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CPGLStatic)
	protected:
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CPGLStatic();	

	// Generated message map functions
protected:
	//{{AFX_MSG(CPGLStatic)
	afx_msg void OnPaint();
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnDestroy();
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	
   
   // The return type for OnNcHitTest has been changed from UINT to LRESULT 
   // to accommodate for negative return values
   #if _MSC_VER >= 1400
	afx_msg LRESULT OnNcHitTest(CPoint point);
   #else
	afx_msg UINT OnNcHitTest(CPoint point); // Keep compatibility with 7.1
   #endif	

   //afx_msg UINT OnNcHitTest(CPoint point);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()

protected:
	//! \name Attributes
	//@{
	//! Region to draw
	CPGLRegionPtr  m_pRegion;
	//! GDI+ interface
	gfxinterface::CGDIpInterface m_GDIpInterface;
	//! flags
	DWORD m_dwFlags;
	//! GDI+ helper
	pgl::CGDIpHelperRegion m_GDIpHelper;
	//@}
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_PGLSTATIC_H__1A9613EC_66EC_4F62_B813_5A19FC4C66CE__INCLUDED_)
